package leetcode_1701_1800;

import java.util.Arrays;

public class LeeCode_1702 {
    public static void main(String[] args) {

    }
    private static String maximumBinaryString(String binary) {
        int count = 0, start = 1000000;
        int n = binary.length();
        for (int i = 0; i < n; i++) {
            char c = binary.charAt(i);
            if (c == '0'){
                count++;
                start = Math.min(i, start);
            }
        }
        if (count < 2)
            return binary;
        char[] ans = new char[n];
        Arrays.fill(ans, '1');
        ans[start + count - 1] = '0';
        return new String(ans);
    }
}
